package com.inspur.dgov.policy.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.inspur.dgov.policy.entity.PolicySubjectRelation;
import com.inspur.dgov.policy.mapper.PolicySubjectRelationMapper;
import com.inspur.dgov.policy.service.PolicySubjectRelationService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 政策专题关系表 服务实现类
 *
 * @author chiyupei
 * @version 1.0
 * @since 1.0
 */
@Slf4j
@Service
@AllArgsConstructor
public class PolicySubjectRelationServiceImpl extends ServiceImpl<PolicySubjectRelationMapper, PolicySubjectRelation> implements PolicySubjectRelationService {

    /**
     * 根据政策id获取政策专题
     * @param policyId
     * @return
     */
    @Override
    public List<PolicySubjectRelation> getPolicySubjectRelationList(String policyId) {
        QueryWrapper<PolicySubjectRelation> queryWrapper = new QueryWrapper();
        queryWrapper.lambda().eq(PolicySubjectRelation::getPolicyId, policyId);
        return this.list(queryWrapper);
    }
}
